package com.seednia.module.core.tagging.dto;

import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.seednia.foundation.framework.dto.AbstractRecord;
import com.seednia.foundation.framework.dto.Constants;
import com.seednia.foundation.framework.dto.ICriteria;

/**
 * Criteria class for tag
 * 
 * @author Young Suk Ahn
 *
 */
@XmlRootElement(name = "TagCriteria", 
namespace = "http://seednia.com/core/1.0")
@XmlType(name = "TagCriteria")
@XmlAccessorType(XmlAccessType.PROPERTY)
public class TagCriteria extends TagDto implements ICriteria {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1325703077089361498L;
	
	private String nameLike = null; // used for the name like '';

	public TagCriteria(){
		this.setSid(Constants.SID_ANY);
	}
	
	@Override
	public Date getCreatedBefore() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Date getCreatedAfter() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public void setSearchText(String value)
	{
		throw new UnsupportedOperationException();
	}
	
	public String getNameLike() {
		return nameLike;
	}

	public void setNameLike(String nameLike) {
		this.nameLike = nameLike;
	}

	/**
	 * To create object from JSONP string
	 * Used by the REST framework when sending this object as parameter
	 * @param jsonStr
	 * @return
	 */
	public static TagCriteria fromString(String jsonStr) {
		TagCriteria retval = (TagCriteria) AbstractRecord.fromString(TagCriteria.class, jsonStr);
		return retval;
	}
}
